﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;

namespace SQLDiag.UI
{
    public partial class FormSQLDiagPath : Form
    {
        public string SQLDiagPath { get; set; }

        public FormSQLDiagPath()
        {
            InitializeComponent();
        }

        private void btnBrowse_Click(object sender, EventArgs e)
        {
            if (DialogResult.OK == this.openFileDialog1.ShowDialog())
            {
                this.tbSQLDiagPath.Text = this.openFileDialog1.FileName;
                SQLDiagPath = this.tbSQLDiagPath.Text.Trim();
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            SQLDiagPath = this.tbSQLDiagPath.Text.Trim();
            this.Close();
        }

        private void FormSQLDiagPath_Load(object sender, EventArgs e)
        {
            SQLDiagPath = ConfigurationManager.AppSettings["SQLDiagPath"].ToString();
            this.tbSQLDiagPath.Text = SQLDiagPath;
        }
    }
}
